﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;
using System.Security.Cryptography;

namespace OnlineAuction.App_Code
{
    public class MaHoaMatKhau
    {
        public string EncriptMD5(string password)
        {
            //Chuyen chuoi mat khau sang dang byte voi bang ma UTF-8
            //Using System.Text;
            byte[] pass = UnicodeEncoding.Default.GetBytes(password);

            //Create MD5CryptoServiceProvider object
            var md5 = new MD5CryptoServiceProvider();

            //Hash pass
            byte[] hashedPass = md5.ComputeHash(pass);

            //Convert hashedPass to String type
            string strPassword = BitConverter.ToString(hashedPass);

            return strPassword;
        }

    }
}